package com.dong;


import com.baomidou.mybatisplus.generator.FastAutoGenerator;
import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;
import java.nio.file.Paths;

public class mybatisMain {
    public static void main(String[] args) {
        FastAutoGenerator.create(
                "jdbc:mysql://localhost:3306/tech?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT%2B8&useSSL=false&allowPublicKeyRetrieval=true",
                        "root",
                        "a200502")
                .globalConfig(builder -> builder
                        .author("dong")
                        .outputDir(Paths.get(System.getProperty("user.dir")) + "/src/main/java")
                        .commentDate("yyyy-MM-dd")
                )
                .packageConfig(builder -> builder
                        .parent("com.dong.mybatis")
                        .entity("entity")
                        .mapper("mapper")
                        .service("service")
                        .serviceImpl("service.impl")
                        .xml("mapper.xml")
                )
                .strategyConfig(builder -> builder
                        .entityBuilder()
                        .enableLombok()
                )
                .templateEngine(new FreemarkerTemplateEngine())
                .execute();
    }
}
//
//
//FastAutoGenerator.create("url", "username", "password")
//        .globalConfig(builder -> builder
//        .author("Baomidou")
//                .outputDir(Paths.get(System.getProperty("user.dir")) + "/src/main/java")
//        .commentDate("yyyy-MM-dd")
//        )
//                .packageConfig(builder -> builder
//        .parent("com.baomidou.mybatisplus")
//                .entity("entity")
//                .mapper("mapper")
//                .service("service")
//                .serviceImpl("service.impl")
//                .xml("mapper.xml")
//        )
//                .strategyConfig(builder -> builder
//        .entityBuilder()
//                .enableLombok()
//        )
//                .templateEngine(new FreemarkerTemplateEngine())
//        .execute();